import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 面包屑
    bread: []
  },
  mutations: {
    // 面包屑
    bread(state, payload) {
      let index = state.bread.filter(item => {
        return item.path == payload.path
      })
      if (index != "") {

      } else {
        state.bread.push(payload)
      }
    },
    // 关闭所有面包屑
    call(state) {
      state.bread = []
    }
  },
  actions: {
  },
  modules: {
  }
})
